/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package terp.gui;

/**
 *
 * @author ilknur
 */
public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    public MainFrame() {
        initComponents();
        createProgramSearchBox();
        setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
    }

    /**
     * Text field on menu bar 
     */
    private void createProgramSearchBox(){
        
        mainMenu.add(filler1);
        mainMenu.add(txtSearch);
        
        //run button
        mainMenu.add(btnRun);
    }
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        txtSearch = new javax.swing.JTextField();
        btnRun = new javax.swing.JButton();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0));
        desktop = new javax.swing.JDesktopPane();
        mainMenu = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        miOpt = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        miExit = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        miHelp = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        miAbout = new javax.swing.JMenuItem();

        txtSearch.setText("Search");
        txtSearch.setToolTipText("");
        txtSearch.setMaximumSize(new java.awt.Dimension(180, 30));
        txtSearch.setPreferredSize(new java.awt.Dimension(180, 30));

        btnRun.setText("Run");
        btnRun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRunActionPerformed(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("T-ERP");

        desktop.setAlignmentX(0.0F);
        desktop.setAlignmentY(0.0F);

        javax.swing.GroupLayout desktopLayout = new javax.swing.GroupLayout(desktop);
        desktop.setLayout(desktopLayout);
        desktopLayout.setHorizontalGroup(
            desktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        desktopLayout.setVerticalGroup(
            desktopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        mainMenu.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                mainMenuComponentResized(evt);
            }
        });

        fileMenu.setText("File");

        miOpt.setText("Options");
        miOpt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miOptActionPerformed(evt);
            }
        });
        fileMenu.add(miOpt);
        fileMenu.add(jSeparator1);

        miExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
        miExit.setText("Exit");
        miExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                miExitActionPerformed(evt);
            }
        });
        fileMenu.add(miExit);

        mainMenu.add(fileMenu);

        helpMenu.setText("Help");

        miHelp.setText("Help");
        helpMenu.add(miHelp);
        helpMenu.add(jSeparator2);

        miAbout.setText("About");
        helpMenu.add(miAbout);

        mainMenu.add(helpMenu);

        setJMenuBar(mainMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktop)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(desktop)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void miExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miExitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_miExitActionPerformed

    private void miOptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_miOptActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_miOptActionPerformed

    private void mainMenuComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_mainMenuComponentResized
        // TODO add your handling code here:
    }//GEN-LAST:event_mainMenuComponentResized

    private void btnRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRunActionPerformed
        // TODO : run program
        
    }//GEN-LAST:event_btnRunActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRun;
    private javax.swing.JDesktopPane desktop;
    private javax.swing.JMenu fileMenu;
    private javax.swing.Box.Filler filler1;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JMenuBar mainMenu;
    private javax.swing.JMenuItem miAbout;
    private javax.swing.JMenuItem miExit;
    private javax.swing.JMenuItem miHelp;
    private javax.swing.JMenuItem miOpt;
    private javax.swing.JTextField txtSearch;
    // End of variables declaration//GEN-END:variables

}
